// 移动端第三方用户授权
import { APPID, HOST, REDIRECT_URL } from '@/utils/envConfig'//环境切换
let userInfo = JSON.parse(localStorage.getItem('userInfo'));//天赋市民云用户

// 授权方法
const outLinkProxy = {
  userInfo: userInfo,
  //(用于获取市民云code)
  oauth() {
    if (!Boolean(this.userInfo)) {
      // 授权地址
      window.location.href = `${HOST}/cauth/oauth/authorize?client_id=${APPID}&redirect_uri=${encodeURIComponent(REDIRECT_URL)}&response_type=code`;
    }
  }
}

export { outLinkProxy }
